<?php
require_once('pworks/common/log/LogEntity.class.php');
require_once('pworks/common/log/AbsStreamLog.class.php');

class FileLog extends AbsStreamLog {

    private $_handle;

    public function open($url){
    	$this->_handle = fopen($url, 'a');
        if(!$this->_handle){
            echo 'Can not Open log file '. $url;
        }
   } 
    public function close() {
        fflush($this->_handle);
        fclose($this->_handle);
        
    }

    
    protected function writeLine($line){
        $line = trim($line) . "\r\n";
        if(fwrite($this->_handle, $line) == false){
            echo "Can not write contetn into log file\n";
        }
    }
}
